const $api = require('../../utils/api.js').API;
var app = getApp()

Page({
  data: {
    is_admin: 0, // 0==用户 1===是大区经理 2===是市场总监
    status: 0, //0 未申请 1待支付 2 待审核 3 已审核 4 已驳回 5 退款中
    avatar: '', //头像
    page: 1,
    buttom: false,
    screenState: -1, //-1 全部 1 待初审  2 待复审 3 已审核 4 初审驳回 5 复审驳回
    screenCancle: 0, //1 待退款初审 2 待退款复审 3 待退款 4 已取消
    screenShow: false, //筛选是否显示
    screenText: '全部', //筛选文字
    rejectReason: '', //驳回原因
    screenList: [], //订单列表
    height: app.globalData.height,
    rightScreen: { //右侧筛选
      real_name: '', //姓名
      phone: '', //手机号
      check_uname: '', //初审人
      shg_province_id: '', //省id
      shg_city_id: '', //市id
    },
    provinceAdress: [], //省地址
    cityAddress: [], //市地址
    addressValue: [0, 0],
    addressVal: [0, 0],
    addressStatus: 0, //1==选择了城市，0==没有选择城市
    isIphoneX: false, //是否是iphoneX
    show_dc: 0, //1==可以购买  0==不可以购买
    bottomViewId: 0,
    scrollHeight: 0,
    viewHeight: 0,
    tc_type:'',
    sqlcList: [
      { img: 'https://jiujinimg.tjnanguyi.com/image/WeChatImg/dianpu/yuedu.png', title: '阅读守则' },
      { img: 'https://jiujinimg.tjnanguyi.com/image/WeChatImg/dianpu/xinxi.png', title: '填写信息' },
      { img: 'https://jiujinimg.tjnanguyi.com/image/WeChatImg/dianpu/goumai.png', title: '填写信息' },
      { img: 'https://jiujinimg.tjnanguyi.com/image/WeChatImg/dianpu/shenhe.png', title: '等待审核' },
    ]
  },

  onShow: function () {
    var _this = this;
    let sceneShow = wx.getStorageSync('sceneShow')
    console.log(app, 11)
    // if (sceneShow && (app.globalData.scene == 1001 || app.globalData.scene == 1017 || app.globalData.scene == 1027 || app.globalData.scene == 1089 || app.globalData.scene == 1005 || app.globalData.scene == 1007 || app.globalData.scene == 1008)) {
    //   _this.setData({
    //     modalName: 'bcmodal'
    //   })
    // }
    let time = new Date().getTime();
    let endday = new Date('2024-02-18 00:00:00').getTime();
    console.log(endday, time)
    if (endday > time) {
      wx.showModal({
        showCancel: false,
        title: '温馨提示',
        content: '所有产品从2024 年 2 月 5 日起暂停发货， 2024 年 2 月 16 日起统一按照订单顺序陆续发货。',
        success(res) {
        }
      })
    }
    // /users/api.user/get_user_info

    $api.getuserinfo({
      login_token: wx.getStorageSync('login_token'),
    }).then((res) => {

      wx.setStorageSync('nick_name', res.data.data.nick_name);
      _this.setData({
        nick_name: res.data.data.nick_name,
        loadModal: false,
        tc_type:res.data.data.tc_type,
        shop_level_name:res.data.data.shop_level_name,
      })
    }).catch((err) => {
      _this.setData({
        loadModal: false
      })
    })
    // 活动专区是否显示
    $api.gethuodongconfig({
      login_token: wx.getStorageSync('login_token'),
    }).then((res) => {

      _this.setData({
        huodongType:res.data.data
      })
    }).catch((err) => {
      _this.setData({
        loadModal: false
      })
    })
    //判断是否为iPhone X
    wx.getSystemInfo({
      success: res => {
        let modelmes = res.model;
        if (modelmes.search('iPhone X') != -1) {
          _this.setData({
            isIphoneX: true
          })
        }
      }
    })

    //判断是否为用户，或审核人员
    var is_admin = wx.getStorageSync('is_admin');
    //是否可以直接查看产品列表1可以0不可以
    var is_prod_user = wx.getStorageSync('is_prod_user');
    //是否首次进入
    var theOne = wx.getStorageSync('theOne');
    _this.setData({
      is_admin: is_admin,
      is_prod_user: is_prod_user,
      loadModal: true,
      page: 1,
      // nick_name: wx.getStorageSync('nick_name'),
      avatar: wx.getStorageSync('avatar'),
      screenShow: false,
      buttom: true,
    })
    if (theOne) {
      //不是首次进入
      var screenState = wx.getStorageSync('screenState');
      var screenText = wx.getStorageSync('screenText');
      var screenCancle = wx.getStorageSync('screenCancle');
      _this.setData({
        screenState: screenState,
        screenText: screenText,
        screenCancle: screenCancle
      })
      var rightScreen = _this.data.rightScreen;
      if (screenCancle == 0) {
        var listData = {
          login_token: wx.getStorageSync('login_token'),
          status: screenState,
          page: 1,
          real_name: rightScreen.real_name,
          phone: rightScreen.phone,
          check_uname: rightScreen.check_uname,
          shg_province_id: rightScreen.shg_province_id,
          shg_city_id: rightScreen.shg_city_id,
        }
      } else {
        var listData = {
          login_token: wx.getStorageSync('login_token'),
          cancle_status: screenCancle,
          page: 1,
          real_name: rightScreen.real_name,
          phone: rightScreen.phone,
          check_uname: rightScreen.check_uname,
          shg_province_id: rightScreen.shg_province_id,
          shg_city_id: rightScreen.shg_city_id,
        }
      }
      $api.shopCheckLists(listData).then((res) => {
        _this.setData({
          screenList: res.data.data.data,
          loadModal: false
        })
      }).catch((err) => {
        _this.setData({
          loadModal: false
        })
      })
    } else {
      //首次进入
      if (is_admin == 0) { // 0==用户
        //获取用户店铺申请状态
        // $api.getShopStatus 旧
        $api.getShopStatusNew({
          login_token: wx.getStorageSync('login_token')
        }).then((res) => {
          console.log(res.data.data, 995)
          _this.setData({
            status: res.data.status, //0 未申请 1待支付 2 待审核 3 已审核 4 已驳回 0未申请 11待登记 20待审核 21 待初审 22 待复审 3 已审核 4 已驳回 5 退款中
            houseData: res.data.data
          })
          //获取是否可以够买大仓
          $api.getDcStatus({
            login_token: wx.getStorageSync('login_token')
          }).then((res) => {
            _this.setData({
              show_dc: res.data.show_dc,
              loadModal: false
            })
          }).catch((err) => {
            _this.setData({
              loadModal: false
            })
          })
          if (res.data.status == 1) {
            //获取获取分批付款的数据
            $api.getShopConfig({
              login_token: wx.getStorageSync('login_token'),
              shop_id: _this.data.houseData.shop_id
            }).then((res) => {
              _this.setData({
                payData: res.data.data
              })
            })
          }



          if (res.data.data.id_card) {
            wx.setStorageSync('id_card', res.data.data.id_card)
          }
          if (res.data.data.phone) {
            wx.setStorageSync('phone', res.data.data.phone)
          }
          if (res.data.data.real_name) {
            wx.setStorageSync('real_name', res.data.data.real_name)
          }
          //判断实名
          console.log(res.data.status)
          // if (res.data.status == 0) {
          //   if (!wx.getStorageSync('id_card') || !wx.getStorageSync('real_name')) {
          //     wx.showToast({
          //       title: '您还未实名认证，请先认证',
          //       icon: 'none',
          //       duration: 2000
          //     })
          //   }
          // }
          //已经申请完成
          if (res.data.status == 3) {
            wx.setStorageSync('is_prod_user', 1);
            _this.setData({ is_prod_user: 1 })
          } else {
            wx.setStorageSync('is_prod_user', 0);
            _this.setData({ is_prod_user: 0 })
          }
          //判断是否需要上拉加载
          if (res.data.data.order_lists.length <= 0) {
            //没有订单加载
            _this.setData({
              buttom: false
            })
          } else {
            _this.setData({
              buttom: true
            })
          }
          //获取店铺订单
          $api.getOrderLists({
            login_token: wx.getStorageSync('login_token'),
            per_page: 10,
            page: 1,
            is_shop_order: 1
          }).then((res) => {
            _this.setData({
              // ['houseData.order_lists']: res.data.data.data,
              loadModal: false,
            })
          }).catch((err) => {
            _this.setData({
              loadModal: false
            })
          })


        }).catch((err) => {
          _this.setData({
            loadModal: false
          })
        })
      } else {
        //1===是大区经理 2===是市场总监
        if (is_admin == 1) {
          var status = 1
          var screenText = "待初审"
        }
        if (is_admin == 2) {
          var status = 2
          var screenText = "待复审"
        }
        //审核人员的审核订单列表
        $api.shopCheckLists({
          login_token: wx.getStorageSync('login_token'),
          status: status,
        }).then((res) => {
          if (res.data.data.data.length <= 0) {
            _this.setData({
              screenList: [],
              buttom: false,
              page: 1
            })
          } else {
            _this.setData({
              screenList: res.data.data.data,
              buttom: true,
              page: 1
            })
          }
          _this.setData({
            screenState: status,
            screenText: screenText,
            loadModal: false
          })
        }).catch((err) => {
          _this.setData({
            loadModal: false
          })
        })

      }
    }

  },
  messageListScrolling(e) {
    console.log(e)
    console.log('已经滑动到底部了');
    this.setData({
      bcdown: true
    })
  },
  oncloseWx(e) {
    wx.showModal({
      title: '温馨提示',
      showCancel: false,
      content: '即将关闭小程序',
      success(res) {
        if (res.confirm) {
          wx.exitMiniProgram({})
          this.setData({ modalName: '' })
        }
      }
    })
  },
  onOpenWx(e) {
    wx.setStorageSync('sceneShow', false)
    this.setData({ modalName: '' })
  },
  onOpentx() {
    wx.showToast({
      title: '请先向上滑动阅读全文',
      icon: 'none',
      duration: 2000
    })
  },
  //立即申请
  onReading() {
    // if (!wx.getStorageSync('id_card') || !wx.getStorageSync('real_name')) {
    //   wx.showToast({
    //     title: '您还未实名认证，请先认证',
    //     icon: 'none',
    //     duration: 2000
    //   })
    // } else {
    wx.navigateTo({
      url: '/pages/reading/reading?step=1&state=1&pzimg=1&scType=1',
    })
    wx.removeStorageSync('shop_id')
    wx.removeStorageSync('goods')
    wx.removeStorageSync('price')
    wx.removeStorageSync('applyShop')
    wx.removeStorageSync('wait_pay')
    wx.removeStorageSync('giftId')
    wx.removeStorageSync('pay')
    wx.removeStorageSync('addressid')
    wx.removeStorageSync('goodsList')
    wx.removeStorageSync('pzimg')
    wx.removeStorageSync('userAddressData');
    wx.removeStorageSync('default_lb_num');
    wx.removeStorageSync('giftnumber');
    wx.removeStorageSync('statusReading');
    wx.removeStorageSync('UpLevelType');
    wx.removeStorageSync('faultnum');
    wx.removeStorageSync('imglist');
    wx.removeStorageSync('giftInfoList');
    // }

  },
  //取消订单
  onWithdraw(e) {
    this.setData({
      modalName: e.currentTarget.dataset.target,
      buttom: false,
      // addressStatus:0,
      // addressValue:[0,0],
      // ['rightScreen.check_uname']:'',
      // ['rightScreen.phone']:'',
      // ['rightScreen.real_name']:'',
      // ['rightScreen.shg_city_id']:'',
      // ['rightScreen.shg_province_id']:'',
    })
  },
  hideModal(e) {
    this.setData({
      modalName: null,
      buttom: true,
      addressStatus: 0,
      addressValue: [0, 0],
      ['rightScreen.check_uname']: '',
      ['rightScreen.phone']: '',
      ['rightScreen.real_name']: '',
      ['rightScreen.shg_city_id']: '',
      ['rightScreen.shg_province_id']: '',
    })
    this.onShow()
  },
  //修改
  onModify(e) {
    var status = this.data.status;
    if (status == 22) {
      //待复审
      wx.navigateTo({
        url: '/pages/details/details?shop_id=' + this.data.houseData.shop_id,
      })
    } else {
      wx.navigateTo({
        url: '/pages/reading/reading?step=1&state=2&pzimg=1&shop_id=' + this.data.houseData.shop_id + '&dzy=' + e.currentTarget.dataset.dzy + '&status=' + status + '&is_sj=' + this.data.houseData.is_sj,
      })
    }

  },
  //去支付
  onWxPay(e) {
    wx.navigateTo({
      url: '/pages/details/details?shop_id=' + this.data.houseData.shop_id,
    })
  },
  //修改头像
  onAvatar() {
    var _this = this;

    $api.uploadImages().then((res) => {
      var avatar = res.url;
      console.log(res)
      $api.editAvatar({
        login_token: wx.getStorageSync('login_token'),
        avatar: avatar
      }).then((res) => {
        _this.setData({
          avatar: avatar
        })
        wx.setStorageSync('avatar', avatar)
      }).catch((err) => {

      })



    }).catch((err) => {
      _this.setData({
        loadModal: false
      })
    })
  },
  //取消申请
  onCancleShopInfo() {
    var _this = this;
    _this.setData({
      loadModal: true
    })
    if (_this.data.status == 6) {
      $api.cancleUpgrade({
        login_token: wx.getStorageSync('login_token'),
        shop_id: _this.data.houseData.shop_id,
        shop_id: _this.data.houseData.shop_id,

      }).then((res) => {
        _this.setData({
          loadModal: false,
          modalName: null
        })
        _this.onShow();
      }).catch((err) => {
        _this.setData({
          loadModal: false
        })
      })
    } else {
      $api.cancleShopInfo({
        login_token: wx.getStorageSync('login_token'),
        shop_id: _this.data.houseData.shop_id
      }).then((res) => {
        _this.setData({
          loadModal: false,
          modalName: null
        })
        _this.onShow();
      }).catch((err) => {
        _this.setData({
          loadModal: false
        })
      })
    }

  },
  //订单详情
  onOrderDetails(e) {
    wx.navigateTo({
      url: '/pages/orderDetails/orderDetails?orderid=' + e.currentTarget.dataset.orderid + '&shop_id=' + this.data.houseData.shop_id,
    })
    wx.removeStorageSync('addressid')
  },
  //查看店铺详情
  onShopDetail() {
    wx.navigateTo({
      url: '/pages/details/details?shop_id=' + this.data.houseData.shop_id + '&type=1',
    })
  },
  //去够买
  onList(e) {
    console.log(e)
    wx.navigateTo({
      url: '/pages/list/list?is_prod_user=' + e.currentTarget.dataset.is_prod_user + '&ds=' + e.currentTarget.dataset.ds,
    })

  },
  //加载
  onReachBottom() {
    var _this = this;
    var page = _this.data.page;
    var buttom = _this.data.buttom;
    var is_admin = _this.data.is_admin;
    var rightScreen = _this.data.rightScreen;
    //审核人员
    if (is_admin != 0) {
      if (buttom) {
        page++;
        if (_this.data.screenCancle == 0) {
          var listData = {
            login_token: wx.getStorageSync('login_token'),
            status: _this.data.screenState,
            page: page,
            real_name: rightScreen.real_name,
            phone: rightScreen.phone,
            check_uname: rightScreen.check_uname,
            shg_province_id: rightScreen.shg_province_id,
            shg_city_id: rightScreen.shg_city_id,
          }
        } else {
          var listData = {
            login_token: wx.getStorageSync('login_token'),
            cancle_status: _this.data.screenCancle,
            page: page,
            real_name: rightScreen.real_name,
            phone: rightScreen.phone,
            check_uname: rightScreen.check_uname,
            shg_province_id: rightScreen.shg_province_id,
            shg_city_id: rightScreen.shg_city_id,
          }
        }
        _this.setData({
          loadModal: true
        })
        $api.shopCheckLists(listData).then((res) => {
          if (res.data.data.data.length <= 0) {
            wx.showToast({
              title: '到底了',
              icon: 'none',
              duration: 2000
            })
            _this.setData({
              buttom: false
            })
          } else {
            _this.setData({
              screenList: _this.data.screenList.concat(res.data.data.data),
              buttom: true,
              page: page,
            })
          }
          _this.setData({
            loadModal: false
          })
        }).catch((err) => {
          _this.setData({
            loadModal: false
          })
        })

      }
    }




  },
  //筛选框显示
  onScreenShow() {
    this.setData({
      screenShow: !this.data.screenShow,
    })
  },
  //点击选择筛选
  onScreen(e) {
    var _this = this;
    _this.setData({
      screenState: e.currentTarget.dataset.screenstate,
      screenText: e.currentTarget.dataset.screentext,
      screenCancle: e.currentTarget.dataset.cancle_status,
      screenShow: false,
      loadModal: true,
      buttom: true,
      page: 1,
    })
    wx.setStorageSync('screenState', e.currentTarget.dataset.screenstate);
    wx.setStorageSync('screenText', e.currentTarget.dataset.screentext);
    wx.setStorageSync('screenCancle', e.currentTarget.dataset.cancle_status);
    wx.setStorageSync('theOne', 1);
    var rightScreen = _this.data.rightScreen;
    if (e.currentTarget.dataset.cancle_status == 0) {
      //正常订单
      var orderData = {
        login_token: wx.getStorageSync('login_token'),
        status: e.currentTarget.dataset.screenstate,
        real_name: rightScreen.real_name,
        phone: rightScreen.phone,
        check_uname: rightScreen.check_uname,
        shg_province_id: rightScreen.shg_province_id,
        shg_city_id: rightScreen.shg_city_id,
        page: 1
      }
    } else {
      //退款订单
      var orderData = {
        login_token: wx.getStorageSync('login_token'),
        cancle_status: e.currentTarget.dataset.cancle_status,
        real_name: rightScreen.real_name,
        phone: rightScreen.phone,
        check_uname: rightScreen.check_uname,
        shg_province_id: rightScreen.shg_province_id,
        shg_city_id: rightScreen.shg_city_id,
        page: 1
      }
    }

    $api.shopCheckLists(orderData).then((res) => {
      _this.setData({
        screenList: res.data.data.data,
        loadModal: false
      })
    }).catch((err) => {
      _this.setData({
        loadModal: false
      })
    })
  },
  //点击查看驳回原因
  onRejectReason(e) {
    this.setData({
      modalName: e.currentTarget.dataset.target,
      rejectReason: e.currentTarget.dataset.text
    })
  },
  //查看详情
  onDetails(e) {
    wx.navigateTo({
      url: '/pages/details/details?shop_id=' + e.currentTarget.dataset.shop_id + '&status=' + e.currentTarget.dataset.status + '&cancle_status=' + e.currentTarget.dataset.cancle_status,
    })
  },
  //退出账号
  onOutAccount() {
    wx.showModal({
      title: '提示',
      content: '您确定要退出吗？',
      success(res) {
        if (res.confirm) {
          wx.clearStorageSync();
          wx.redirectTo({
            url: '/pages/login/pass/pass',
          })
        } else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })

  },
  //下拉刷新
  onPullDownRefresh() {
    var _this = this;
    _this.setData({
      loadModal: true
    })
    setTimeout(function () {
      _this.onShow();
      wx.stopPullDownRefresh()
    }, 1000)



  },
  //发货
  onFaHuo(e) {
    var _this = this;
    _this.setData({
      loadModal: true
    })
    $api.fahuo({
      login_token: wx.getStorageSync('login_token'),
      shop_id: e.currentTarget.dataset.id
    }).then((res) => {
      _this.setData({
        loadModal: false
      })
      setTimeout(function () {
        _this.onShow();
      }, 500)
    }).catch((err) => {
      _this.setData({
        loadModal: false
      })
    })
  },
  //获取右侧筛选内容
  onRightScreen(e) {
    var _this = this;
    var rightscreenidx = e.currentTarget.dataset.rightscreenidx;
    if (rightscreenidx == 0) {
      //姓名
      _this.setData({
        ['rightScreen.real_name']: e.detail.value
      })
    }
    if (rightscreenidx == 1) {
      //手机号
      _this.setData({
        ['rightScreen.phone']: e.detail.value
      })
    }
    if (rightscreenidx == 2) {
      //初审人
      _this.setData({
        ['rightScreen.check_uname']: e.detail.value
      })
    }



  },
  //地址弹出
  addressShowModal(e) {
    var _this = this;
    var provinceAdress = _this.data.provinceAdress;
    //判断初审复审
    var is_admin = _this.data.is_admin;
    _this.setData({
      addressmodalName: e.currentTarget.dataset.target,
    })
    if (is_admin == 1) {
      //初审人员
      if (provinceAdress.length <= 0) {
        _this.setData({
          loadModal: true,
        })
        //获取初审人员所管辖的省地址
        $api.getAdminManageProvices({
          login_token: wx.getStorageSync('login_token'),
        }).then((res) => {
          _this.setData({
            provinceAdress: res.data.data,
          })
          //获取初审人员所管辖的市地址
          $api.getArea({
            login_token: wx.getStorageSync('login_token'),
            level: parseInt((res.data.data[0].region_level) + 1),
            pid: res.data.data[0].id
          }).then((res) => {
            _this.setData({
              cityAddress: res.data.data,
              loadModal: false,

            })
          }).catch((err) => {
            _this.setData({
              loadModal: false
            })
          })
        }).catch((err) => {
          _this.setData({
            loadModal: false
          })
        })
      }

    }
    if (is_admin == 2) {
      //复审人员
      if (provinceAdress.length <= 0) {
        _this.setData({
          loadModal: true,
        })
        //获取所有省地址
        $api.getArea({
          login_token: wx.getStorageSync('login_token'),
          level: 1
        }).then((res) => {
          _this.setData({
            provinceAdress: res.data.data,
          })
          //获取所有市地址
          $api.getArea({
            login_token: wx.getStorageSync('login_token'),
            level: parseInt((res.data.data[0].region_level) + 1),
            pid: res.data.data[0].id
          }).then((res) => {
            _this.setData({
              cityAddress: res.data.data,
              loadModal: false,

            })
          }).catch((err) => {
            _this.setData({
              loadModal: false
            })
          })
        }).catch((err) => {
          _this.setData({
            loadModal: false
          })
        })
      }

    }


  },
  //滑动省，获取市
  onProvinceAddress(e) {
    console.log(e.detail.value);
    var _this = this;
    var addressVal = e.detail.value;
    $api.getArea({
      login_token: wx.getStorageSync('login_token'),
      level: parseInt((_this.data.provinceAdress[addressVal[0]].region_level) + 1),
      pid: _this.data.provinceAdress[addressVal[0]].id
    }).then((res) => {
      _this.setData({
        cityAddress: res.data.data,
        addressVal: addressVal
      })
    }).catch((err) => {

    })
  },
  //地址隐藏
  addressHideModal() {
    this.setData({
      addressmodalName: null,
      addressStatus: 0,
      addressValue: [0, 0],
      ['rightScreen.shg_city_id']: '',
      ['rightScreen.shg_province_id']: ''
    })
  },
  //地址确认
  onAddressConfirm() {
    var addressVal = this.data.addressVal;
    var provinceAdress = this.data.provinceAdress;
    var cityAddress = this.data.cityAddress;
    this.setData({
      addressStatus: 1,
      addressValue: addressVal,
      addressmodalName: null,
      ['rightScreen.shg_province_id']: provinceAdress[addressVal[0]].id,
      ['rightScreen.shg_city_id']: cityAddress[addressVal[1]].id
    })
  },
  //完成筛选
  onComplete() {
    var _this = this;
    _this.setData({
      modalName: null,
      page: 1,
      buttom: true,
      loadModal: true,
    })
    var rightScreen = _this.data.rightScreen; //右侧筛选填写内容
    var screenCancle = _this.data.screenCancle;
    var screenState = _this.data.screenState;
    if (screenCancle == 0) { //正常订单
      var listData = {
        login_token: wx.getStorageSync('login_token'),
        status: screenState,
        real_name: rightScreen.real_name,
        phone: rightScreen.phone,
        check_uname: rightScreen.check_uname,
        shg_province_id: rightScreen.shg_province_id,
        shg_city_id: rightScreen.shg_city_id,
        page: 1
      }
    } else {
      var listData = {
        login_token: wx.getStorageSync('login_token'),
        cancle_status: screenCancle,
        real_name: rightScreen.real_name,
        phone: rightScreen.phone,
        check_uname: rightScreen.check_uname,
        shg_province_id: rightScreen.shg_province_id,
        shg_city_id: rightScreen.shg_city_id,
        page: 1
      }
    }
    $api.shopCheckLists(listData).then((res) => {
      _this.setData({
        screenList: res.data.data.data,
        loadModal: false
      })
    }).catch((err) => {
      _this.setData({
        loadModal: false
      })
    })

  },
  //进入首页
  onIndex() {
    wx.reLaunch({
      url: '/pages/index/index',
    })
  },
  //进入我的
  onMine() {
    wx.reLaunch({
      url: '/pages/mine/mine',
    })
  },
  // 进入直播
  onlive() {
    wx.reLaunch({
      url: '/pages/live/live',
    })
  },
  //进入商品列表
  ongoodslist() {
    wx.reLaunch({
      url: '/pages/goodslist/goodslist',
    })
  },
  //进入首页home
  onhome() {
    wx.reLaunch({
      url: '/pages/home/home',
    })
  },
  // 进入修改凭证
  modifyvoucher(){
    wx.reLaunch({
      url: '/pages/modifyvoucher/modifyvoucher?shop_id=' + this.data.houseData.shop_id,
    })
  }
})